<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="body">
	
		<rich:panel>
			<f:facet name="header">Person List</f:facet>
	
			<div class="results">
			<h:outputText value="No person exists"
				rendered="#{empty personList.resultList}" />
				 
			<h:dataTable id="personList" 
				var="person" 
				value="#{personList.resultList}" 
				cellspacing="10"
				rendered="#{not empty personList.resultList}">
				
				<h:column>
					<f:facet name="header">Id</f:facet>
					#{person.id}
				</h:column>
	       
				<h:column>
					<f:facet name="header">Name</f:facet>
					<s:link id="person" 
						value="#{person.name}" 
						propagation="none"
						view="/view/person.xhtml">
						<f:param name="personId" value="#{person.id}" />
					</s:link>
				</h:column>

				<h:column>
					<f:facet name="header">Email</f:facet>
					<h:outputText value="#{person.email}" />
				</h:column>

				<h:column>
					<f:facet name="header">Interests</f:facet>
					<h:outputText value="#{person.interestsAsString}" />
				</h:column>

				<h:column>
					<f:facet name="header">Contactperson for</f:facet>
					<h:outputText value="#{person.contactForCompaniesAsString}" />
				</h:column>

				<h:column>
					<f:facet name="header">Spoken Languages</f:facet>
					<h:outputText value="#{person.spokenLanguagesAsString}" />
				</h:column>

			</h:dataTable>
			</div>
	
		</rich:panel>
	
		<div class="actionButtons">
			<s:button id="done"	
				value="Create person" 
				view="/view/person.xhtml" />
		</div>
	
	</ui:define>

</ui:composition>
